package com.neuralnoise.flickr;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

public class FlickrProperties {

	private static final String DEFAULT_PROPERTIES_FILENAME = "flickr.properties";
	
	private String apiKey;
	private String secret;
	private String token;
	
	private String startUser;
	private long millis;
	
	public FlickrProperties(String fileName) throws ConfigurationException {
		Configuration config = new PropertiesConfiguration(fileName);
		this.setApiKey(config.getString("flickr.apiKey"));
		this.setSecret(config.getString("flickr.secret"));
		this.setToken(config.getString("flickr.token"));
		
		this.setStartUser(config.getString("flickr.startUser"));
		this.setMillis(config.getLong("flickr.millis"));
	}

	public FlickrProperties() throws ConfigurationException {
		this(DEFAULT_PROPERTIES_FILENAME);
	}
	
	public String getApiKey() {
		return apiKey;
	}

	public void setApiKey(String apiKey) {
		this.apiKey = apiKey;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getStartUser() {
		return startUser;
	}

	public void setStartUser(String startUser) {
		this.startUser = startUser;
	}

	public long getMillis() {
		return millis;
	}

	public void setMillis(long millis) {
		this.millis = millis;
	}
	
}
